					<form method="post" id="master_job" action="#">
						<div class="col-sm-5"><label for="nama_jabatan" class="control-label">Job Position<span style="color:red;">*</span></label></div>
						<div class="col-sm-7">
							<select id="nama_jabatan" name="nama_jabatan" class="form-control input-sm required">                         
								<option value="0">-- select --</option>
							<?php
								if (!empty($nama_jabatan)) { 
									foreach($job_select as $job_select => $key)
									{ ?>
										<option value="<?php echo $key['JOB']; ?>"<?php echo (strtoupper($nama_jabatan) == strtoupper($key['JOB'])) ? 'selected' : ''; ?>><?php echo $key['JOB']; ?></option>									
									<?php
									}
								} else {
									foreach($job_select as $job_select => $key)
									{ ?>
										<option value="<?php echo $key['JOB']; ?>"><?php echo $key['JOB']; ?></option>									
									<?php
										//echo '<option value="'.$key['JOB'].'">'.$key['JOB'].'</option>';
									}		
								}
							?>
							</select>						
						</div>
						<div class="col-sm-5"><label for="status" class="control-label">Status<span style="color:red;">*</span></label></div>
						<div class="col-sm-7">
							<select id="status_name" name="status_name" class="form-control input-sm required">       
								<?php
								if (!empty($status_name)) {
								?>
									<option value="">-- select --</option>
									<option value="PERMANEN"<?php echo (strtoupper($status_name) == 'PERMANEN') ? 'selected' : ''; ?>>PERMANEN</option>
									<option value="KONTRAK"<?php echo (strtoupper($status_name) == 'KONTRAK') ? 'selected' : ''; ?>>KONTRAK</option>
								<?php 
								} else {
								?>
									<option value="">-- select --</option>
									<option value="PERMANEN">PERMANEN</option>
									<option value="KONTRAK">KONTRAK</option>													
								<?php
								}
								?>
							</select>						
						</div>
						<div class="col-sm-12" style="margin-top:2px;">&nbsp;</div>
						<div class="col-sm-4">
							<!--button type="reset" class="btn btn-default btn-block">Clear</button-->
						</div>
						<div class="col-sm-4"></div>
						<div class="col-sm-4">
							<button type="button" class="btn btn-primary btn-block" onclick="search_data1();">
							<!--span class="glyphicon glyphicon-search"></span--> Search</button>
						</div>
						<div style="margin-top:20px" class="col-sm-8"><label for="work_facility" class="control-label"><b class="caret"></b> Work Facility Request</label></div>
						<div class="col-md-12">
							<div class="table-responsive">
							<table class="table table-bordered table-condensed table-striped">
								<thead><tr>
									<th>No</th>
									<th>Name</th>
									<th>Status</th>
									<?php
										if (!empty($list_data1)) {
									?>
											<th>Action</th>
									<?php
										}
									?>
								</tr></thead>
								<tbody>
									<?php
										if (empty($list_data1) && (empty($nama_jabatan) || empty($status_name))) {
											?>
											<tr><td colspan="3" style="text-align:center">No Data Available</td></tr>
											<?php 
										} else if (!empty($list_data1)) {
											$no_urut = 0; 
											foreach ($list_data1 as $row) {
												$no_urut++;
											?>
												<tr>
													<td style="text-align:center;"><?php echo $no_urut; ?>.</td>
													<td style="text-align:left;"><?php echo $row['RI_NAME']; ?></td>
													<td>
														<select id="ri_status<?php echo $no_urut; ?>" class="form-control input-sm">                         
															<option value="">-- select --</option>
															<option value="Y"<?php echo (strtoupper($row['RI_STATUS']) == 'Y') ? 'selected' : ''; ?>>Active</option>
															<option value="N"<?php echo (strtoupper($row['RI_STATUS']) == 'N') ? 'selected' : ''; ?>>Not Active</option>															
														</select>								
													</td>
													<td>
													<a class="btn btn-sm btn-warning" href="#" onclick="edit_data1('<?php echo $row['RI_NAME']; ?>','<?php echo $no_urut; ?>');">
														<!--span class="glyphicon glyphicon-edit"></span--> Edit</a>
													<a class="btn btn-sm btn-danger" href="#" onclick="delete_data1('<?php echo $row['RI_NAME']; ?>');">
														<!--span class="glyphicon glyphicon-remove"></span--> Delete</a>
													</td>
												</tr>
											<?php 
											}											
											if (!empty($list_fasilitas_kerja_new)) { ?>
												<tr>
													<td style="text-align:center;"><?php echo $no_urut+1; ?>.</td>
													<td>
														<select id="work_awal1" class="form-control input-sm">                         
															<option value="0">-- select --</option>
														<?php 
															foreach($list_fasilitas_kerja_new as $key)
															{
																echo '<option value="'.$key['RI_NAME'].'">'.$key['RI_NAME'].'</option>';
															} 
														?>							
														</select>
													</td>
													<td>
														<select id="status_awal1" class="form-control input-sm">                         
															<option value="">-- select --</option>
															<option value="Y">Active</option>
															<option value="N">Not Active</option>															
														</select>
													</td>
													<td>
														<a class="btn btn-sm btn-success" href="#" onclick="add_data1();">
														<!--span class="glyphicon glyphicon-plus"></span--> Add</a>
													</td>																																					
												</tr>
											<?php
											}
										} else {
									?>
												<tr>
													<td style="text-align:center;">1.</td>
													<td>
														<select id="work_awal1" class="form-control input-sm">                         
															<option value="0">-- select --</option>
														<?php 
															foreach($list_fasilitas_kerja as $keysz)
															{
																echo '<option value="'.$keysz['RI_NAME'].'">'.$keysz['RI_NAME'].'</option>';
															} 
														?>							
														</select>
													</td>
													<td>
														<select id="status_awal1" class="form-control input-sm">                         
															<option value="">-- select --</option>
															<option value="Y">Active</option>
															<option value="N">Not Active</option>															
														</select>
													</td>
												</tr>
									<?php
										}
									?>
								</tbody>
							</table>
							</div>
						</div>
						<div style="margin-top:20px" class="col-sm-8"></div>
						<div class="col-sm-4">
							<?php
							if (empty($list_data1) && !empty($nama_jabatan)) {
							?>
								<button type="button" class="btn btn-success btn-block" onclick="add_data1();">
								<!--span class="glyphicon glyphicon-plus"></span--> Add New</button>
							<?php
							} else if (empty($list_data1) && empty($nama_jabatan)) {
							?>
								<button type="button" class="btn btn-default btn-block" >No Action</button>
							<?php
							} 
							?>
						</div>
						<div style="margin-top:20px" class="col-sm-8"><label for="room_facility" class="control-label"><b class="caret"></b> Room Facility Request</label></div>
						<div class="col-md-12">
							<div class="table-responsive">
							<table class="table table-bordered table-condensed table-striped">
								<thead><tr>
									<th>No</th>
									<th>Name</th>
									<th>Status</th>
									<?php
										if (!empty($list_data2)) {
									?>
											<th>Action</th>
									<?php
										}
									?>
								</tr></thead>
								<tbody>
									<?php
										if (empty($list_data2) && (empty($nama_jabatan) || empty($status_name))) {
											?>
											<tr><td colspan="3" style="text-align:center">No Data Available</td></tr>
											<?php
										} else if (!empty($list_data2)) {
											$no_urut2 = 0; 
											foreach ($list_data2 as $row2) {
												$no_urut2++;
											?>
												<tr>
													<td style="text-align:center;"><?php echo $no_urut2; ?>.</td>
													<td style="text-align:left;"><?php echo $row2['RI_NAME']; ?></td>
													<td>
														<select id="ri_status2<?php echo $no_urut2; ?>" class="form-control input-sm">                         
															<option value="">-- select --</option>
															<option value="Y"<?php echo (strtoupper($row2['RI_STATUS']) == 'Y') ? 'selected' : ''; ?>>Active</option>
															<option value="N"<?php echo (strtoupper($row2['RI_STATUS']) == 'N') ? 'selected' : ''; ?>>Not Active</option>															
														</select>
													</td>
													<td>
													<a class="btn btn-sm btn-warning" href="#" onclick="edit_data2('<?php echo $row2['RI_NAME']; ?>','<?php echo $no_urut2; ?>');">
														<!--span class="glyphicon glyphicon-edit"></span--> Edit</a>
													<a class="btn btn-sm btn-danger" href="#" onclick="delete_data2('<?php echo $row2['RI_NAME']; ?>');">
														<!--span class="glyphicon glyphicon-remove"></span--> Delete</a>
													</td>
												</tr>
											<?php 
											} //echo ($no_urut2);											 
											if (!empty($list_fasilitas_ruang_kerja_new)) { ?>
												<tr>
													<td style="text-align:center;"><?php echo $no_urut2+1; ?>.</td>
													<td>
														<select id="work2_awal" class="form-control input-sm">                         
															<option value="0">-- select --</option>
														<?php 
															foreach($list_fasilitas_ruang_kerja_new as $key)
															{
																echo '<option value="'.$key['RI_NAME'].'">'.$key['RI_NAME'].'</option>';
															} 
														?>							
														</select>
													</td>
													<td>
														<select id="status2_awal" class="form-control input-sm">                         
															<option value="">-- select --</option>
															<option value="Y">Active</option>
															<option value="N">Not Active</option>															
														</select>
													</td>
													<td>
														<a class="btn btn-sm btn-success" href="#" onclick="add_data2();">
														<!--span class="glyphicon glyphicon-plus"></span--> Add</a>
													</td>
												</tr>
											<?php
											}
										} else {
									?>
												<tr>
													<td style="text-align:center;">1.</td>
													<td>
														<select id="work2_awal" class="form-control input-sm">                         
															<option value="0">-- select --</option>
														<?php 
															foreach($list_fasilitas_ruang_kerja as $keys)
															{
																echo '<option value="'.$keys['RI_NAME'].'">'.$keys['RI_NAME'].'</option>';
															} 
														?>							
														</select>
													</td>
													<td>
														<select id="status2_awal" class="form-control input-sm">                         
															<option value="">-- select --</option>
															<option value="Y">Active</option>
															<option value="N">Not Active</option>															
														</select>
													</td>
												</tr>
									<?php
										}
									?>
									
								</tbody>
							</table>
							</div>
						</div>
						<div class="col-sm-8"></div>
						<div class="col-sm-4">
							<?php
							if (empty($list_data2) && !empty($nama_jabatan)) {
							?>
								<button type="button" class="btn btn-success btn-block" onclick="add_data2();">
								<!--span class="glyphicon glyphicon-plus"></span--> Add New</button>
							<?php
							} else if (empty($list_data2) && empty($nama_jabatan)) {
							?>
								<button type="button" class="btn btn-default btn-block" >No Action</button>
							<?php
							} 
							?>
						</div>
					</form>	